// components/tabbar-2/s-tabbar.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected:0,
    color:'#666666',
    selectedColor: "#E7D600",
    list:[{
      pagePath: "/pages/togetherDish/index",
      iconPath: "/lib/icon/home-1.png",
      selectedIconPath: "/lib/icon/home-2.png",
      text: "首页"
    },{
      pagePath: "/pages/togetherDish/order/order",
      iconPath: "/lib/icon/order-2.png",
      selectedIconPath: "/lib/icon/order-1.png",
      text: "我的订单"
    }]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchtab(e){
      const data=e.currentTarget.dataset;
      const url=data.path;
      wx.navigateTo({
        url: url,
      })
      this.setData({
        selected:data.index
      })
    }
  }
})
